public class LambdaExample {
    public static void main(String[] args) {
       /* Calculator adder = new Calculator() {

            public int calculate(int a, int b) {
                return a+b;
            }
        };


        int result= adder.calculate(7,3);
        System.out.println("结果"+result);*/
        Calculator adder=( a, b)->a+b;
        Calculator jf=( a, b)->a-b;
        Calculator cf=( a, b)->a*b;
        Calculator chufa=( a, b)->a/b;

        int resultadd= adder.calculate(5,3);
        System.out.println("加法结果"+resultadd);
        int resultjf= jf.calculate(5,3);
        System.out.println("减法结果"+resultjf);
        int resultcf = cf.calculate(5,3);
        System.out.println("乘法结果"+resultcf);
        int resultchufa= chufa.calculate(5,3);
        System.out.println("除法结果"+resultchufa);

    }
};

